Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.rdl
Class Message_Struct

    java.lang.Object
      rdlc.rdl.Declaration_Named
          rdlc.rdl.Message_Struct

All Implemented Interfaces:
  Declaration, Expression, Message

     class Message_Struct

extends Declaration_Named
implements Message

Structured message, modeled after "stucts" in C. Messages of this type can have any number of fields of various bitwidths, including structured and union fields.

Version:
  $Revision: 1.16 $
Author:
  Greg Gibeling

Nested Class Summary

Nested classes/interfaces inherited from interface rdlc.rdl.Expression
`Expression.Phase`

Field Summary
`protected Catalog<java.lang.String,Message>` | `fieldTable` A catalog of bindings from name to fields.
`protected java.lang.Boolean` | `isVariableWidth` Flag to specify whether this is a variable width struct.
`protected Expression.Phase` | `resolved` A flag to prevent us from trying to resolve the statics in this message twice.
`protected int` | `width` The bitwidth of this message.

Fields inherited from class rdlc.rdl.Declaration_Named
`iName, namespace, rawStaticID`

Constructor Summary
`Message_Struct()` Default constructor, used during parsing to create an empty structured message.

Method Summary
`void` | `add(java.util.List vMessageStructFieldDecl, Log errorLog)` Add a list of message fields to this message struct.
`Catalog<java.lang.String,Message>` | `getFields()` Simple accessor.
`java.lang.String` | `getLambdaName()` Simple accessor.
`java.util.Hashtable<java.lang.String,java.lang.Integer>` | `getName2Tag()` Simple accessor.
`java.util.Hashtable<java.lang.Integer,java.lang.String>` | `getTag2Name()` Simple accessor.
`int` | `getTagWidth()` Simple accessor.
`int` | `getWidth()` Simple accessor.
`boolean` | `isVariableWidth()` Simple accessor.
`void` | `resolve(java.util.HashSet<Declaration> markSet, Log errorLog, Expression.Phase phase)` Resolve the qualified name of this declaration.
`void` | `setNamespace(Namespace _namespace)` This method builds on the default implementation in `Declaration_Named.setNamespace(Namespace)` to set the namespacec on all of the fields of this structured message.
`java.lang.String` | `toString()` Simple accessor.
`boolean` | `typeMatch(Expression e)` Will only match against another structured message with the same fields and types.

Methods inherited from class rdlc.rdl.Declaration_Named
`getBase, getIdentifier, getNamedBase, getRawStaticID, getRequirements, getType, setRawStaticID`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface rdlc.rdl.Declaration
`getBase, getIdentifier, getNamedBase, getType, setRawStaticID`

Methods inherited from interface rdlc.rdl.Expression
`getRequirements`

Field Detail

### fieldTable

    protected Catalog<java.lang.String,Message> fieldTable

  A catalog of bindings from name to fields.

### resolved

    protected Expression.Phase resolved

  A flag to prevent us from trying to resolve the statics in this message twice. Basically to save us a lot of potentially wasted cycles.

### width

    protected int width

  The bitwidth of this message. This is cached, as it can be expensive to determine.

### isVariableWidth

    protected java.lang.Boolean isVariableWidth

  Flag to specify whether this is a variable width struct. Cached, as it can be very expensive to determine.

Constructor Detail

### Message_Struct

    public Message_Struct()

  Default constructor, used during parsing to create an empty structured message. Fields are added later as they are parsed.

Method Detail

### toString

    public java.lang.String toString()

  Simple accessor.

  Overrides:
    `toString` in class `Declaration_Named`
  Returns:
    A human readable representation of this map for debugging.

### getWidth

    public int getWidth()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `getWidth` in interface `Message`
  Returns:
    The maximum total (including the tag) bitwidth of this message type.
  See Also:
    `Message.getWidth()`

### getTagWidth

    public int getTagWidth()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `getTagWidth` in interface `Message`
  Returns:
    The bitwidth of the tag for this port.
  See Also:
    `Message.getTagWidth()`

### getName2Tag

    public java.util.Hashtable<java.lang.String,java.lang.Integer> getName2Tag()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `getName2Tag` in interface `Message`
  Returns:
    A hashtable mapping from field names to tag values.
  See Also:
    `Message.getName2Tag()`

### getTag2Name

    public java.util.Hashtable<java.lang.Integer,java.lang.String> getTag2Name()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `getTag2Name` in interface `Message`
  Returns:
    A hashtable mapping from tag values to field names.
  See Also:
    `Message.getTag2Name()`

### getFields

    public Catalog<java.lang.String,Message> getFields()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `getFields` in interface `Message`
  Returns:
    `null` for simple messages, a catalog of the fields otherwise.
  See Also:
    `Message.getFields()`

### isVariableWidth

    public boolean isVariableWidth()

  Description copied from interface: `Message`
  Simple accessor.

  Specified by:
    `isVariableWidth` in interface `Message`
  Returns:
    `true` if the width of the messages can vary at run time.
  See Also:
    `Message.isVariableWidth()`

### add

    public void add(java.util.List vMessageStructFieldDecl,
                    Log errorLog)

  Add a list of message fields to this message struct. The first entry in the argument list is the type of all of the fields to be added, and the remainder of the list is a list of field names.

  Parameters:
    `vMessageStructFieldDecl` - A list with the type and list of field names.
    `errorLog` - A list of all the errors to be reported.

### setNamespace

    public void setNamespace(Namespace _namespace)

  This method builds on the default implementation in `Declaration_Named.setNamespace(Namespace)` to set the namespacec on all of the fields of this structured message.

  Specified by:
    `setNamespace` in interface `Expression`
  Overrides:
    `setNamespace` in class `Declaration_Named`
  Parameters:
    `_namespace` - The namespace in which this declaration was declared. This may not be the same as the one in which it is eventually bound.
  See Also:
    `Declaration_Named.setNamespace(Namespace)`

### resolve

    public void resolve(java.util.HashSet<Declaration> markSet,
                        Log errorLog,
                        Expression.Phase phase)

  Description copied from class: `Declaration_Named`
  Resolve the qualified name of this declaration.

  Specified by:
    `resolve` in interface `Expression`
  Overrides:
    `resolve` in class `Declaration_Named`
  Parameters:
    `markSet` - Complete hash set of declarations on which the caller depends (including itself).
    `errorLog` - Log of errors to be reported to the user.
    `phase` - The phase of resolution to perform.
  See Also:
    `Expression.resolve(HashSet, Log, Phase)`, `Expression.resolve(HashSet, Log, Phase)`

### typeMatch

    public boolean typeMatch(Expression e)

  Will only match against another structured message with the same fields and types. This should only be called when unnamed messages are used directly in unit ports, structs or unions since RDL has a named type system.

  Specified by:
    `typeMatch` in interface `Expression`
  Parameters:
    `e` - The expression to check this one against.
  Returns:
    `true` if these two expressions match in type.
  See Also:
    `Expression.typeMatch(Expression)`

### getLambdaName

    public java.lang.String getLambdaName()

  Description copied from interface: `Declaration`
  Simple accessor.

  Specified by:
    `getLambdaName` in interface `Declaration`
  Returns:
    This gives a type name with size of the structure and a hash of the fields in it.
  See Also:
    `Declaration.getLambdaName()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD